package com.news.upload;

import android.content.Context;
import android.widget.Toast;

import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.news.MainApplication;
import com.news.cos.BizService;
import com.news.cos.PutObjectSample;

/**
 * Created by Administrator on 2017/7/7.
 */
public class UploadModule extends ReactContextBaseJavaModule {

    BizService bizService;
    private Context mContext;
    public UploadModule(ReactApplicationContext reactContext) {
        super(reactContext);
        mContext = reactContext;
        bizService = BizService.instance();
        bizService.init(MainApplication.getInstance());
    }

    @Override
    public String getName() {
        return "uploadModule";
    }


    @ReactMethod
    public void uploadImg(){
        Toast.makeText(mContext,"ssss",Toast.LENGTH_SHORT).show();
        PutObjectSample.putObjectForSamllFile(bizService,"/-1954225470.jpg","/storage/emulated/0/HappyGame/ImagePic/-1954225470.jpg");
    }


}
